﻿@model EditArticleModel

@{
    ViewBag.Title = "Edit";
}

<div class="folder">
    <h2 class="folder-heading">
        @if(Model.IsNew())
        {
            @Loc("Create new article.");
        }
        else
        {
            @String.Format(Loc("Edit article: {0}"), Model.Title);
        }
    </h2>

    @using (Html.BeginForm("edit", "article"))
    {
        <div class="editor-item w735">
            <div class="editor-label">
                @Html.LabelFor(m => m.Title)
            </div>
            <div class="editor-field">
                @Html.EditorFor(m => m.Title)
                @Html.ValidationMessageFor(m => m.Title)
            </div>
        </div>
        <div class="clear"></div>
        
        <div class="editor-item w735">
            <div class="editor-label">
                @Html.LabelFor(m => m.Content)
            </div>
            <div class="editor-field">
                @Html.EditorFor(m => m.Content)
                @Html.ValidationMessageFor(m => m.Content)
            </div>
        </div>
        <div class="clear"></div>
        
        if (Model.IsNew())
        { 
            <div class="editor-item w300">
                <div class="editor-label">
                    @Html.LabelFor(m => m.Culture)
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(m => m.Culture, new SelectListItem[] {
                        new SelectListItem {
                            Text = (L)"English",
                            Value = "en",
                            Selected = true
                        },
                        new SelectListItem {
                            Text = (L)"Czech",
                            Value = "cs"
                        }
                    })
                    @Html.ValidationMessageFor(m => m.Culture)
                </div>
            </div>
            <div class="clear"></div>
        }
        else
        {
            @Html.HiddenFor(m => m.Culture)
        }
        
        <input type="submit" name="save" value="@Loc("Save article")" />
    }
</div>
